"use strict"

"use strict"

let mongoose 	= require('mongoose');
let Schema 		= mongoose.Schema;

let QywxAccessTokenSchema = new Schema({
	corpId: { type: String, required: true, index: { unique: true } },
  accessToken: { type: String, required: true },
  lockedForRefresh: { type: String, required: true, default: false },
  lockedAt: { type: Date },
	expiresAt: { type: Date, required: true },
	createdAt : { type: Date, default: Date.now },
	updatedAt : { type: Date },
	deletedAt : { type: Date }
});

module.exports = mongoose.model('QywxAccessToken', QywxAccessTokenSchema);
